<template>
  <div id="app">
    <nav-bar left-arrow @clickLeft="$goPageBack()"/>
    <search-bar 
      :showCity='true' 
      @changeLastCity="resetLastCity"
    />
    <list-wrap v-if="!reloadProdList" />
    <slogan/>
  </div>
</template>
<script>
  import Search from '@cmpt/header/search';//搜索模块
  import ListWrap from '../components/list-wrap'
  import NavBar from "@cmpt/header/navbar"
  import Slogan from '@cmpt/slogan'
    export default {
      name: "productList",
      components: {
        [Search.name]: Search,
        [ListWrap.name]: ListWrap,
        [NavBar.name]: NavBar,
        [Slogan.name]: Slogan
      },
      data() {
        return {
          reloadProdList: false, // 强制刷新
        }
      },
      methods: {
        resetLastCity(code){
          this.reloadProdList = true
          this.$nextTick( () => {
            this.reloadProdList = false
          })
        }
      }
    }
</script>

